<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/layui.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/view.css"/>
    <title></title>
</head>
<body>
    <div style="width: 100%; height: 100%;" id="view">
    	<img src="${pageContext.request.contextPath }/img/zhm4.png" usemap="testMap" id="KnMap"/>
	   	<map name="testMap" id="testMap">
	   		<area  shape="rect" coords="68,240,253,428" target="_blank"  href="${pageContext.request.contextPath }/stockMenu/toMembraneBoardPage.do" title="热法纺丝区"/>
	    	<area shape="rect" coords="68,525,552,713" href="${pageContext.request.contextPath }/stockMenu/toMembraneBoardPage.do" alt=""  target="_blank" title="湿法纺丝区"/>
	    	<area shape="rect" coords="595,531,774,713" href="${pageContext.request.contextPath }/Kanban/assemble.do" alt=""  target="_blank" title="自动组装区"/>
	    	<area shape="rect" coords="795,531,1166,713" href="${pageContext.request.contextPath }/Kanban/lxj.do" alt=""  target="_blank" title="离心封装区"/>
	    	<area shape="rect" coords="1322,240,1600,713" href="${pageContext.request.contextPath }/evaluateBoard/enterEvaluateBoardPage.do" alt=""  target="_blank" title="成品检验区"/>
	   	</map>
    </div>
    <script src="${pageContext.request.contextPath }/assets/layui.all.js"></script>
    <script>
     //var element = layui.element;
   	function resetHostArea(){
		var srcw="835", srch="1660";
		//var noww=$("#KnMap").prop("innerWidth")*1.0; 
		//var noww=document.getElementById('#KnMap').prop("innerWidth")*1.0
		var o = document.getElementById("view");
		var h = o.offsetHeight; //高度
		var w = o.offsetWidth; //宽度
		var scale = noww/srcw;
		var areas = document.getElementsByTagName("area");
		var coords;

		areas.each(function(){
			coords = this.coords;
			coords = coords.split(",");
			coords = Math.round(coords[0]*scale)+","+Math.round(coords[1]*scale)+","+Math.round(coords[2]*scale)+","+Math.round(coords[3]*scale);
			this.coords=coords;
		});
	}
	resetHostArea();
	window.onresize=resetHostArea;
	
    </script>
</body>
</html>